ℹ️Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке
📌 Что делает решето Эратосфена
Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей. ➡️ Как это работает
▪️ Создаём массив от 2 до N
▪️ Берём первое невычеркнутое число p
▪️ Вычеркиваем все кратные p
▪️ Переходим к следующему невычеркнутому числу
▪️ Повторяем, пока p² <= N
Пример на Python:
def eratosthenes(n): sieve = [True] * (n+1) sieve[0:2] = [False, False] for i in range(2, int(n**0.5) + 1): if sieve[i]: for j in range(i*i, n+1, i): sieve[j] = False return [i for i, prime in enumerate(sieve) if prime]
ℹ️Как компьютеры находят простые числа в тысячи раз быстрее, чем ты на бумажке
📌 Что делает решето Эратосфена
Находит все простые числа от 1 до N — быстро, эффективно и без перебора делителей. ➡️ Как это работает
▪️ Создаём массив от 2 до N
▪️ Берём первое невычеркнутое число p
▪️ Вычеркиваем все кратные p
▪️ Переходим к следующему невычеркнутому числу
▪️ Повторяем, пока p² <= N
Пример на Python:
def eratosthenes(n): sieve = [True] * (n+1) sieve[0:2] = [False, False] for i in range(2, int(n**0.5) + 1): if sieve[i]: for j in range(i*i, n+1, i): sieve[j] = False return [i for i, prime in enumerate(sieve) if prime]
The messaging service and social-media platform owes creditors roughly $700 million by the end of April, according to people briefed on the company’s plans and loan documents viewed by The Wall Street Journal. At the same time, Telegram Group Inc. must cover rising equipment and bandwidth expenses because of its rapid growth, despite going years without attempting to generate revenue.
Dump Scam in Leaked Telegram Chat
A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.